const app = getApp();
var url = app.getURL();

Page({
  data: {
    listdata:[]
  },

  //加载初始数据
  onLoad: function (options) {
    this.loadmore();
  },

  //触底事件
  onReachBottom:function(){
  },

  //发起请求
  loadmore:function(){
    var that = this;
    let id = wx.getStorageSync('message').id;
  //请求服务器
    wx.request({
      url:url+'/app/comm/record/auth/queryViewList/'+id,
      method: "GET",
      header: {
        'content-type': 'application/json',
        token:wx.getStorageSync('cookieToken')
      },
      success(res) {
        console.log(res.data.data)
        that.setData({
          listdata: res.data.data
        })
      }
    })
  },
  // 返回顶部
  onPageScroll: function (e) {
    // console.log(e.scrollTop)
    if (e.scrollTop>300) {
      this.setData({
        showTop: true
      })
    } else {
      this.setData({
        showTop: false
      })
    }
  },
  goTop: function () {
    wx.pageScrollTo({
      scrollTop: 0,
      duration: 300
    })
  }
})
